package com.carlinfo.users.pojo;

import java.util.Date;

/**
 * @author Gonsen
 * 
 */
public class AProd {

	/**
	 * 属性对应数据库表中的字段，一一对应
	 */
	private String id;
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	private int cateId; //分类id
	private String name; //名称
	private String imgPath; //图片路径
	private String content; //内容:描述
	private byte recomStatus; //推荐标识:0:不推荐,1:推荐(会在首页显示)
	private byte status; //状态:0:禁用,1:启用
	private Date createTime; //创建时间
	private Date updateTime; //更新时间
	private Date pubTime; //发布时间(用来排序)

	/*添加一个枚举类用于状态的描述,状态的字符串描述*/
	private String statusStr;
	
	public String getStatusStr() {
		AProdEnum[] prodEnums = AProdEnum.values();
		for (int i = 0; i < prodEnums.length; i++) {
			AProdEnum prodEnum = prodEnums[i];
			if(prodEnum.toString().startsWith("STATUS")){
				if(this.getStatus() == prodEnum.getStatus()){
					this.statusStr = prodEnum.getName();
				}
			}
		}
		return statusStr;
	}

	/**
	 * get、set读写器
	 */
	public int getCateId() {
		return cateId;
	}

	public void setCateId(int cateId) {
		this.cateId = cateId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getImgPath() {
		return imgPath;
	}

	public void setImgPath(String imgPath) {
		this.imgPath = imgPath;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public byte getRecomStatus() {
		return recomStatus;
	}

	public void setRecomStatus(byte recomStatus) {
		this.recomStatus = recomStatus;
	}

	public byte getStatus() {
		return status;
	}

	public void setStatus(byte status) {
		this.status = status;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public Date getPubTime() {
		return pubTime;
	}

	public void setPubTime(Date pubTime) {
		this.pubTime = pubTime;
	}
}
